<?php

namespace plugin\muadmin\app\common\model;

use think\Model;

class Plugin extends Model
{
    protected $name = 'plugin';
    protected $pk = 'id';
    protected $autoWriteTimestamp = 'datetime';
    protected $createTime = 'createtime';
    protected $updateTime = false;
    public function setRequireAttr($value)
    {
        if(!empty($value)){
            if(is_array($value)){
                $value = implode(',',$value);
            }
        }
        return $value;
    }
    public function getRequireAttr($value)
    {
        if(!empty($value)){
            if(is_string($value)){
                $value = explode(',',$value);
            }
        }else{
            $value = [];
        }
        return $value;
    }
}